package elan.book.control;

import android.content.Intent;
import elan.book.Render.RenderBase;

public class controlUI {

	public static int UI_CurrentView;
	// every type of UI has only one cache
	// level1
	public static final int UI_SquareGrid = 0;
	// level2
	public static final int UI_GreatBooks = 1;
	public static final int UI_BookMark = 2;
	// level3
	public static final int UI_SerachView = 3;
	// level4
	public static final int UI_NetbookList = 4;
	public static final int UI_SerachResult = 5;
	// level5
	public static final int UI_NetbookInfo = 6;
	// level6
	public static final int UI_NetbookComments = 7;
	// level10
	public static final int UI_NetbookView = 10;
	public static final int UI_LocalbookView = 11;
	// level11
	public static final int UI_Help = 12;

//	private static BookCilentActivity instance = null;

	// if CurrentView!=null,press backbutton, then you can back to it.
	public static void goToView(int UI_type, RenderBase currentView) {
		if (currentView != null) {
			pushtoStack(currentView);
		}
		findinCache(UI_type);
		Intent intent = new Intent();
		switch (UI_type) {
		case UI_SquareGrid:
			intent.setClass(currentView.getApplicationContext(), elan.book.Render.UI_SquareGrid.class);
			break;
		case UI_LocalbookView:
			intent.setClass(currentView.getApplicationContext(), elan.book.Render.UI_LocalbookView.class);
			break;
		case UI_GreatBooks:
			intent.setClass(currentView.getApplicationContext(), elan.book.Render.UI_GreatBooks.class);
			break;
		default:
			break;
		}
		currentView.startActivity(intent);
	}
	
	private static void findinCache(int UI_type) {
		// TODO Auto-generated method stub

	}

	private static void pushtoStack(RenderBase currentView) {

	}

	private static RenderBase getPreView() {
		return null;
	}
}
